# Target 接口
class MicroUSB:
    def recharge(self):
        print('MicroUSB...')


# Adaptee 类
class LightningCharger:
    def recharge_with_lightning(self):
        print("Recharging with lightning port.")


# Adapter 类
class LightningToMicroUSBAdapter(MicroUSB):
    def __init__(self, lightning_charger):
        self.lightning_charger = lightning_charger

    def recharge(self):
        print("Adapter converts MicroUSB to Lightning")
        self.lightning_charger.recharge_with_lightning()


# 客户端代码
def recharge_phone_with_micro_usb(phone):
    phone.recharge()


lightning_charger = LightningCharger()
adapter = LightningToMicroUSBAdapter(lightning_charger)
recharge_phone_with_micro_usb(adapter)

'''
Adapter converts MicroUSB to Lightning
Recharging with lightning port.
'''